﻿using System.Collections.Generic;
using System.Linq;
using Amazon.EC2.Model;

namespace Web_App___AWS_ELB_Monitor
{
    public static class AWSExtensions
    {
        public static IEnumerable<RunningInstance> ReadInstancesFromLoadBalancer(this DescribeInstancesResult insResp)
        {
            return insResp.Reservation.SelectMany(res => res.RunningInstance).Where(ins => ins != null);
        }
    }
}